<?php
/**
 * Enlighten updater allows quick easy updates
 * 
 * The update manager can install files using plugins stored in the plugin folder
 *
 */

include('../dbal/dbal.php');

class EnlightenUpdater
{
	var $metadata;
	var $fileList;
	var $uri;
	var $handler;
	
	function EnlightenUpdater()
	{
		
	}
	
	function ReadPackage($uri)
	{
		$bits = parse_url($uri);
		if(!file_exists("plugins/{$bits['scheme']}Plugin.class.php'"))
		{
			return false;
		}
		require("plugins/{$bits['scheme']}Plugin.class.php'");
		$classname = "{$bits['scheme']}EnlightenPlugin";
		$this->handler = new $classname($uri);
	}
	
	function InstallPackage($uri)
	{
		$bits = parse_url($uri);
		if(!file_exists("plugins/{$bits['scheme']}Plugin.class.php'"))
		{
			return false;
		}
		require("plugins/{$bits['scheme']}Plugin.class.php'");
		$classname = "{$bits['scheme']}EnlightenPlugin";
		$this->handler = new $classname($uri);
	}
	
	function UpdateAll()
	{
		
	}
}
?>